<?php if($_SERVER['HTTP_X_REQUESTED_WITH']==''): ?>
<?php get_header(); ?>	
<div id="accordion">
    <?php include_once (TEMPLATEPATH . '/inc/menu-home.php' ); ?>
    <div class="panel active hasdata">
		<div class="pink news-menu" rel="pushstate"></div>
		<div class="panelContent p2">
<?php endif; ?>
        <?php include_once (TEMPLATEPATH . '/inc/language-nav.php' ); ?>
		<?php if($_SERVER['HTTP_X_REQUESTED_WITH']==''): ?>
			<div class="container-860"><?php endif; ?>					
				<section class="container-548 news">
				<h1>NEWS</h1>
				<?php 
					if (have_posts()) : while (have_posts()) : the_post(); 		
						$supersized 		= get_post_meta(get_the_ID(), 'bg-supersized', true);			
						$slides = array();
						if($supersized != NULL && !empty($supersized)):
							foreach($supersized as  $photo_id)
								$slides[] = wp_get_attachment_image_src($photo_id, 'full');
						endif;						
				?>
						<div class="news-item">
							<h4><?php the_title();?></h4>
							<h5>PUBLISHED: <?php the_time('F jS, Y'); ?></h5>
							<?php include (TEMPLATEPATH . '/inc/share.php' ); ?>
							<div id="slider-news-<?php the_ID()?>>" class="royalSlider default haszoom container-548">		
								<ul class="royalSlidesContainer">
								<?php if(!empty($slides)): foreach($slides as $slide): ?>
									<li class="royalSlide">
										<img class="royalImage" src="<?php echo $slide[0]?>" width="100%" height="100%"/>
										<div class="royalCaption">
											<a href="<?php echo $slide[0]?>" rel="lightbox" class="zoom"></a>
										</div> 				
									</li>
								<?php endforeach; endif; ?>
								</ul>		
							</div>	    		
							<div class="content"><?php the_content(); ?></div>		
						</div>
					<?php endwhile; endif; ?>				
				</section>			
				<script>
					$(document).ready(function() {
						$("div[id^='slider-news-']").royalSlider({
							captionShowEffects:["moveleft", "fade"],
							imageScaleMode: "fill",				
							slideshowDelay:5000,					
						}); 
						if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
							jQuery(function($) {
								$("a[rel^='lightbox']").picbox({/* Put custom options here */}, null, function(el) {
									return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
								});
							});
						}
					});		
				</script>
				<?php if($_SERVER['HTTP_X_REQUESTED_WITH']==''): ?>
			</div>
		</div>
    </div>
    
	<?php include_once (TEMPLATEPATH . '/inc/menu-works.php' ); ?>
	<?php include_once (TEMPLATEPATH . '/inc/menu-contact.php' ); ?>
	<?php include_once (TEMPLATEPATH . '/inc/menu-about.php' ); ?>    
	
</div>
<?php get_footer(); ?>
<?php get_footer(); 
	else:
		set_title_header();
	endif;
?>